/********************************************************************************
Name:  PreferredContactEmail
Copyright © 2012  HFH International
======================================================
======================================================
Purpose:
-------
To make only two active Contact Email as preferred (one web email and one email)
======================================================
======================================================
History 
-------
VERSION  AUTHOR                DATE        DETAIL              
  1.0  - CG DEV TEAM    7/10/2012   INITIAL DEVELOPMENT  
*********************************************************************************/ 
trigger PreferredContactEmail on Contact_Email__c(before insert,before update,before delete) {

ContactEmailTriggerHandler triggerhandler=new ContactEmailTriggerHandler(); 
    
        if((trigger.isInsert && trigger.isBefore)){
          
             triggerhandler.ContactEmailInsert(trigger.new);                    
            }
            if(trigger.isUpdate && trigger.isBefore){
            
                triggerhandler.ContactEmailUpdate(trigger.new,trigger.old);
            }
            if(trigger.isdelete && trigger.isBefore){
              triggerhandler.ContactEmailDelete(trigger.old);
            }

}